package com.bwhx.eruler.service.impl;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bwhx.eruler.bean.Order;
import com.bwhx.eruler.bean.Page;
import com.bwhx.eruler.bean.Ruler;
import com.bwhx.eruler.dao.BaseDao;
import com.bwhx.eruler.dao.OrderDao;
import com.bwhx.eruler.dao.RulerDao;
import com.bwhx.eruler.service.OrderService;

/**
 * @Description:
 */
@Service
public class OrderServiceImpl implements OrderService {
	@Autowired 
	OrderDao orderDao;
	@Autowired
	RulerDao rulerDao;

	//带条件查询
	public List<Order> find(Order order) {
		return orderDao.find(order);
	}

	
	public Order get(Serializable oId) {
		// TODO Auto-generated method stub
		return orderDao.get(oId);
	}

	
	public void insert(Order order) {
		orderDao.insert(order);
		
	}

	
	
	
	public void delete(Serializable id) {

		orderDao.delete(id);
		
	}

	
	public void delete(Serializable[] ids) {
		// TODO Auto-generated method stub
		
	}


	@Override
	public List<Order> findByName(String ordername) {
		
		return orderDao.findByName(ordername);
	}


	@Override
	public void inputOrder(Order o) {
		orderDao.inputOrder(o);		
	}


	@Override
	public List<Order> list(Page p) {
		return orderDao.list(p);
	}


	@Override
	public Integer count(Order o) {
		return orderDao.count(o);

	}


	@Override
	public List<Order> orderListAll() {
		return orderDao.orderListAll();
	}


	@Override
	public void batchInsert(ArrayList<Order> orders) {
		orderDao.batchInsert(orders);
		
	}


	@Override
	public void update(Order order, List<Ruler> rulers) {
		orderDao.update(order);
		
		rulerDao.updateByOrder(rulers);
		
	}


	@Override
	public void del(String oId) {
		orderDao.del(oId);
		
	}

}
